import request, { requestNew } from '@/utils/request'
// 活动信息
export async function getActivity(data = {}) {
  const res = await requestNew({
    url: '/hongbao-app/rain/newest',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'post',
    data
  })
  return res
}

// 活动信息
export async function getActivityApp(data = {}, option = {}) {
  const res = await requestNew({
    url: '/hongbao-app/rain/newest/app',
    headers: {
      'Content-Type': 'application/json',
      'showLoading': true,
      'showMessage': true,
      ...option
    },
    method: 'post',
    data
  })
  return res
}

// 获取红包雨基本配置
export async function getBaseInfo(params = {}) {
  const res = await requestNew({
    url: '/hongbao-app/config/get',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'get',
    params
  })
  return res
}

// 提交红包雨结果
export async function submitPacket(data = {}) {
  const res = await requestNew({
    url: '/hongbao-app/rain/submit',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'post',
    data
  })
  return res
}

// 提交红包雨结果
export async function getPacketMoney(params = {}) {
  const res = await requestNew({
    url: '/hongbao-app/rain/result',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'get',
    params
  })
  return res
}

// 获取所有红包列表
export async function getPacketMoneyRewards(params = {}) {
  const res = await request({
    url: '/hongbao-app/list/all',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'get',
    params
  })
  return res
}

// 获取可用红包列表
export async function getPacketMoneyUnUse(params = {}) {
  const res = await requestNew({
    url: '/hongbao-app/list/unused',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'get',
    params
  })
  return res
}

// 获取不可用红包列表
export async function getPacketMoneyUsed(params = {}) {
  const res = await requestNew({
    url: '/hongbao-app/list/expired',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'get',
    params
  })
  return res
}
